#安装docker此操作可能需要一点时间
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

#启动docker
systemctl start docker

#开机自启
systemctl enable docker

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://5twf62k1.mirror.aliyuncs.com"],
  "exec-opts": ["native.cgroupdriver=systemd"]
}
EOF

sudo systemctl daemon-reload
sudo systemctl restart docker

systemctl start docker

systemctl enable docker